package com.wn.ziroom.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wn.ziroom.entity.Quarters;
import com.wn.ziroom.mapper.QuartersMapper;
import com.wn.ziroom.service.QuartersService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wn.ziroom.vo.QuarterInMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wangzhijia
 * @since 2023-02-24 12:56:47
 */
@Service
public class QuartersServiceImpl extends ServiceImpl<QuartersMapper, Quarters> implements QuartersService {

    private QuartersMapper quartersMapper;
    @Autowired
    public void setQuartersMapper(QuartersMapper quartersMapper) {
        this.quartersMapper = quartersMapper;
    }



    @Override
    public List<Quarters> selectall() {
        return quartersMapper.selectList(null);
    }

    @Override
    public List<QuarterInMap> getAllForMap() {
        return   quartersMapper.selectAllForMap();
    }



    @Override
    public Quarters selectByQname(Double name) {
        QueryWrapper<Quarters> objectQueryWrapper = new QueryWrapper<>();
            objectQueryWrapper.eq("price_ratio",name);
       return   quartersMapper.selectOne(objectQueryWrapper);
    }
}
